package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.CodeTableBo;
import com.ruoyi.system.mapper.PscmAreaReadMapper;
import com.ruoyi.system.service.PscmAreaReadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 获取行政区划接口实现 （读）
 *
 * @author wenjie
 * @mail wenjie@yinhai.com
 * @date 2020/4/26
 * @time 17:03
 * @since 1.0.0
 */
@Service("pscmAreaReadService")
public class PscmAreaReadServiceImpl  implements PscmAreaReadService {

    @Autowired
    private PscmAreaReadMapper pscmAreaReadMapper;




    @Override
    public List<CodeTableBo> getProvince(){
        return pscmAreaReadMapper.getProvince();
    }

    @Override
    public List<CodeTableBo> getChildLevel(String pId){
        if(pId == null || pId == ""){
            throw new RuntimeException("获取子级行政区划代码失败，为传入上级行政区划代码");
        }
        return pscmAreaReadMapper.getChildLevel(pId);
    }


}
